#-------------------------------------------------------------------------
#  Copyright (c) 1995-99, All rights reserved by
# 
#  CPPLIB Corporation
#  171 South Street
#  Hopkinton, MA  USA
#
#  This software is furnished under a license and may be used and copied
#  only  in  accordance  with  the  terms  of such  license and with the
#  inclusion of the above copyright notice. This software or  any  other
#  copies thereof may not be provided or otherwise made available to any
#  other person. No title to and ownership of  the  software  is  hereby
#  transferred.
# 
#  The information in this software is subject to change without notice
#  and should not be construed as a commitment by CPPLIB Corporation.
# 
#  CPPLIB Corporation assumes no responsibility for the use or reliability
#  of this software.
# 
#---------------------------------------------------------------------------
# 
# 	mrules.mk - Make rules file, included by all system makefiles
# 
#---------------------------------------------------------------------------
## ==>>
#  Author Identification
# 
# 	RFO	Roger F. Osmond, Amalasoft
# 	SET	Sonia Trindade, CPPLIB
#       ALG     Arie L. Golos, A.S.I
#       PAC     Patti Casamassima, CPPLIB
# 
#---------------------------------------------------------------------------
#  Audit Trail
# 
#  009 PAC 15-Apr-02	Added rules for .exp
#  008 RFO 13-Feb-02	Added rules for acs/ace, merged nas_base with real one
#  007 ALG 21-Sep-00    Added rules for xml, xsd, dtd, svg, xsl
#  006 ST 20-Oct-99    Added confs rule to deal with conf files that are
#		       different for LINUX.
#  005 ST 29-Jun-99    Added ef rule - executable files
#  004 ALG 09-Jul-97    Added jap rules
#  003 ALG 19-Apr-97    Added java rules
#  002 SET 17-Oct-96	Changed HTMLPP to HTMLPPSH.
#  001 RFO 21-Mar-96	Added rules for HTML files
#  000 RFO 18-Oct-95	Added header, audit trail
#---------------------------------------------------------------------------

include $(ACM_ROOT)/acm_config/suffixes

#ifeq ($(BLACKBIRD_CS),YES)
#BLACKBIRD = -DBLACKBIRD
#else
#BLACKBIRD =
#endif
#
#CFLAGS += $(BLACKBIRD)

.txt:
	$(RM) $@
	cp $< $@

.c.o:
	$(RM) $@
	$(CC) $(CFLAGS) -c $<

.cxx.o:
	$(RM) $@
	$(CCC) $(CCC_FLAGS) $(USER_CXX_DEBUG) $(CCC_STRICT) -c $<

.cc.o:
	$(RM) $@
	$(CCC) $(CCC_FLAGS) -c $<

.C.o:
	$(RM) $@
	$(CCC) $(CCC_FLAGS) -c $<

.cpp.o:
	$(RM) $@
	$(CCC) $(CCC_DEBUG) $(CCC_FLAGS) $(CCC_STRICT) -c $<

.sh:
	$(RM) $@
	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` -D `str_to_upper $(ACM_PRODUCT)` $(BLACKBIRD) < $< | $(SHGF) > $@
	chmod +x $@
#	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` < $< | $(SHGF) > $@

.pl:
	$(RM) $@
	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` $(BLACKBIRD) < $< | $(SHGF) > $@
	chmod +x $@

.cfgs.cfg:
	$(RM) $@
	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` -D `str_to_upper $(ACM_PRODUCT)` $(BLACKBIRD) < $< | $(SHGF) > $@
#	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` < $< | $(SHGF) > $@

.confs.conf:
	$(RM) $@
	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` -D `str_to_upper $(ACM_PRODUCT)` < $< | $(SHGF) > $@
#	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` < $< | $(SHGF) > $@

.jars.jar:
	$(RM) $@
	cp $< $@
	chmod +w $@

.src:
	$(RM) $@
	ln -s $< $@

.ef:
	$(RM) $@
	cp $< $@
	chmod +x $@

.df:
	$(RM) $@
	$(DCON) $<

.sf:
	$(RM) $@
	$(SHGF) < $< > $@

.hts.htm:
	$(RM) $@
	$(HTMLPPSH) $(HTMLPP_FLAGS) -f $< -o $@

.jss.js:
	$(RM) $@
	$(HTMLPPSH) $(HTMLPP_FLAGS) -f $< -o $@

#.hsh:
#	$(RM) $@
#	$(SHGF) < $< | $(HTMLPP) $(HTMLPP_FLAGS) > $@
#	chmod +x $@

.hsh:
	$(RM) $@
	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` -D `str_to_upper $(ACM_PRODUCT)` $(HTMLPP_FLAGS) -D _NO_JAVASCRIPT < $< | $(SHGF) > $@
	chmod +x $@
#	$(HTMLPP) -D `str_to_upper $(ACM_THOST)` $(HTMLPP_FLAGS) -D _NO_JAVASCRIPT < $< | $(SHGF) > $@

.acs.x_.ace: 
	$(HTMLPPSH) -D EIFFEL_5 -I. $(HTMLPP_FLAGS) -f $< -o $@
	chmod 664 $@

.java.class:
	$(JAVAC) $(JAVAC_LOCAL_FLAGS) -classpath $(J_LOCAL_CLASSPATH) -d $(J_CLASSES) $<
	echo DONE > $@

.jap.java:
	$(JPP) $(LOCAL_JPP_FLAGS) $< > $@

.jap.dpd:	 
	$(JPP) -M  $(JPP_INCLUDES) $< | sed -e 's+$*.o+$*.java+g' >> make.dpd

# XML files
.xmls.xml:
	$(RM) $@
	cp $< $@

# W3 Schema data definition files
.xsds.xsd:
	$(RM) $@
	cp $< $@

# XML Data Type Definition files
.dtds.dtd:
	$(RM) $@
	cp $< $@

# X Style sheet files
.xsls.xsl:
	$(RM) $@
	cp $< $@


# Scaleable Vector Graphics files
.svgs.svg:
	$(RM) $@
	cp $< $@

.exps.exp:
	$(RM) $@
	cp $< $@

